#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<string.h>

int main()
{
    int a = 0, b = 0, sum = 0, i = 0, j = 0, k = 0;
    scanf("%d %d", &a, &b);
    scanf("%d", &sum);
    for (i = 1, j = 1, k = 1; i <= sum; i++, j++, k++)
    {
        if (j > a)
            j = 1;
        if (k > b)
            k = 1;
        printf("%d %d\n", j, k);
    }
    return 0;
}